package com.hezuti.info.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Property;
import org.springframework.stereotype.Component;

import com.hezuti.common.dao.BaseHibernateDaoGeneric;
import com.hezuti.info.domain.Province;

@Component
public class ProvinceDao extends BaseHibernateDaoGeneric<Province> {

	/**
	 * 按照国家id 查找所有省份
	 * @param cid
	 * @return
	 */
	public List<Province> findAllByCid(int cid) {
		Criteria criteria = this.createCriteria(Property.forName(
				Province.FIELD_CID).eq(cid));
		return this.findBy(criteria);
	}

}
